package com.ylq.impl;

import com.ylq.dao.RolesDao;
import com.ylq.entity.PageVo;
import com.ylq.entity.Roles;
import com.ylq.service.RolesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

/**
 * @Author qiang
 * @Description TODO
 * @Date 2020-04-27
 **/
@Service
public class RolesServiceImpl implements RolesService{
    @Autowired
    private RolesDao rolesDao;
    Roles roles =  new Roles();


    @Override
    public int createRole(Roles roles) {
        UUID uuid = UUID.randomUUID();
        roles.setUid(uuid.toString());
        return rolesDao.createRole(roles);
    }

    @Override
    public int updateRole(Roles roles) {
        return rolesDao.updateRole(roles);
    }

    @Override
    public List<Roles> getRolesLayUI(Integer offSet, Integer limit) {
        return rolesDao.getRolesLayUI(offSet, limit);
    }

    @Override
    public int countAllRoles() {
        return rolesDao.countAllRoles();
    }

    @Override
    public int deleteRole(String roleId) {
        return rolesDao.deleteRole(roleId);
    }

    @Override
    public List<Roles> getRolesAll() {
        return rolesDao.getRolesAll();
    }

    @Override
    public List<Roles> getRolesByUserIdLayUI(String uId) {
        return rolesDao.getRolesByUserIdLayUI(uId);
    }

    @Override
    public int deleteRm(String roleId) {
        return rolesDao.deleteRm(roleId);
    }

    @Override
    public List<Roles> findOtherRoles(String uId) {
        return rolesDao.findOtherRoles(uId);
    }


}
